package com.bingguo;

import com.bingguo.interceptor.BackFormatHandler;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;

/**
 * @EnableDiscoveryClient 这个注解不加好像也可以注册到nacos里面
 */
@SpringBootApplication
@EnableFeignClients
@EnableDiscoveryClient
public class providerApplication {

    /**
     * 加上这个代码块主要是为了让durid不打印 discard long time none received connection
     */
    static {
        System.setProperty("druid.mysql.usePingMethod","false");
    }

    public static void main(String[] args) {
        ApplicationContext  ctx = SpringApplication.run(providerApplication.class,args);
        String[] beanNamesForType = ctx.getBeanNamesForType(BackFormatHandler.class);
        //测试容器中是否有bean
        for (String s : beanNamesForType) {
            System.err.println(s);
        }
    }
}
